<%--
  Created by IntelliJ IDEA.
  User: Admin
  Date: 2016/8/22
  Time: 12:22
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html>
<head>
    <title>Title</title>
    <style>
        .error{ color: red}
    </style>
</head>
<body>

<c:if test="${!empty requestScope.message}">
    <br>
    <font color="red">${requestScope.message}</font>
    <br><br>
</c:if>
    <form action="/user/addUser" method="post" id="addUserForm">
        Username:<input type="text" name="userName" placeholder="userName" value="${param.username}"/><br><br>
        Password:<input type="password" name="password" placeholder="password" value="${param.password}"/><br><br>
        AccountId:<input type="text" name="accountId" placeholder="accountId" value="${param.accountId}"/><br><br>

        <button type="submit" >保存</button>
        &nbsp;&nbsp;
        <a href="index.jsp">返回</a>
    </form>
<script src="http://static.runoob.com/assets/jquery-validation-1.14.0/lib/jquery.js"></script>
<script src="http://static.runoob.com/assets/jquery-validation-1.14.0/dist/jquery.validate.min.js"></script>
    <script>
        $("#addUserForm").validate({
            rulers: {
                userName: {
                    required: true
                },
                password: {
                    required: true,
                    minlength: 3
                }
            }
            ,
            messages:{
                userName:{
                    required: "请输入用户名"
                },
                password: {
                    required: "请输入密码",
                    minlength: "密码长度不能小于 3 个字母"
                }
            }
        });
    </script>
</body>
</html>
